const cp = require('child_process');
let child1 = cp.exec('node test1.js', {
  cwd: '../../test'
}, (err, stdout, stderr) => {
  if (err) {
    console.log('open fail');
    process.exit()
  } else {
    console.log('子进程标准输出', stdout.toString());
    child2.stdin.write(stdout.toString())
  }
})
let child2 = cp.exec('node test.js', (err, stdout, stderr) => {
  console.log(err);
  process.exit()
})